VERSION 5.00
Begin VB.Form frmAddUsr 
   Caption         =   "Add user"
   ClientHeight    =   4200
   ClientLeft      =   60
   ClientTop       =   450
   ClientWidth     =   4800
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   Moveable        =   0   'False
   ScaleHeight     =   4200
   ScaleWidth      =   4800
   StartUpPosition =   1  'CenterOwner
   Begin VB.CommandButton cmdClose 
      Caption         =   "Close"
      Height          =   495
      Left            =   3120
      TabIndex        =   11
      Top             =   3360
      Width           =   1335
   End
   Begin VB.CommandButton cmdAdd 
      Caption         =   "Add"
      Enabled         =   0   'False
      Height          =   495
      Left            =   240
      TabIndex        =   10
      Top             =   3360
      Width           =   1335
   End
   Begin VB.ComboBox comRole 
      Height          =   315
      Left            =   2040
      TabIndex        =   9
      Text            =   "Select a role"
      Top             =   2040
      Width           =   2415
   End
   Begin VB.TextBox txtEmail 
      Height          =   285
      Left            =   2040
      TabIndex        =   8
      Top             =   2640
      Width           =   2415
   End
   Begin VB.TextBox txtPassword 
      Height          =   285
      Left            =   2040
      TabIndex        =   7
      Top             =   1440
      Width           =   2415
   End
   Begin VB.TextBox txtLogin 
      Height          =   285
      Left            =   2040
      TabIndex        =   6
      Top             =   840
      Width           =   2415
   End
   Begin VB.TextBox txtName 
      Height          =   285
      Left            =   2040
      TabIndex        =   5
      Top             =   330
      Width           =   2415
   End
   Begin VB.Label Label4 
      AutoSize        =   -1  'True
      Caption         =   "Email"
      BeginProperty Font 
         Name            =   "Arial"
         Size            =   14.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   330
      Left            =   240
      TabIndex        =   4
      Top             =   2640
      Width           =   705
   End
   Begin VB.Label Label3 
      AutoSize        =   -1  'True
      Caption         =   "Role"
      BeginProperty Font 
         Name            =   "Arial"
         Size            =   14.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   330
      Left            =   240
      TabIndex        =   3
      Top             =   2040
      Width           =   600
   End
   Begin VB.Label lblpassowrd 
      AutoSize        =   -1  'True
      Caption         =   "Password"
      BeginProperty Font 
         Name            =   "Arial"
         Size            =   14.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   330
      Left            =   240
      TabIndex        =   2
      Top             =   1440
      Width           =   1260
   End
   Begin VB.Label lblLogin 
      AutoSize        =   -1  'True
      Caption         =   "Login"
      BeginProperty Font 
         Name            =   "Arial"
         Size            =   14.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   330
      Left            =   240
      TabIndex        =   1
      Top             =   840
      Width           =   705
   End
   Begin VB.Label lbName 
      AutoSize        =   -1  'True
      Caption         =   "Name"
      BeginProperty Font 
         Name            =   "Arial"
         Size            =   14.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   330
      Left            =   240
      TabIndex        =   0
      Top             =   240
      Width           =   750
   End
End
Attribute VB_Name = "frmAddUsr"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub cmdAdd_Click()
    Dim connector As New ADODB.Connection
    Dim rs As New ADODB.Recordset
    connector.CursorLocation = adUseClient
    connector.ConnectionString = "DRIVER={MySQL ODBC 3.51 Driver};" _
    & "SERVER=127.0.0.1;" _
    & "DATABASE=incidences;" _
    & "UID=root;" _
    & "OPTION=" & 1 + 2 + 8 + 32 + 2048 + 16384
    connector.Open
    rs.ActiveConnection = connector
    rs.CursorType = adOpenDynamic
    rs.CursorLocation = adUseClient
    rs.LockType = adLockOptimistic
    rs.Open ("insert into users values (" & Me.comRole.ListIndex & ",'" & Me.txtName.Text & "','" & Me.txtLogin.Text & "','" & Me.txtPassword.Text & "','" & Me.txtEmail.Text & "')")
    Me.txtEmail.Text = ""
    Me.txtLogin.Text = ""
    Me.txtPassword.Text = ""
    Me.txtName.Text = ""
End Sub

Private Sub cmdClose_Click()
    Me.Hide
End Sub

Private Sub comRole_Click()
    Me.cmdAdd.Enabled = True
End Sub

Private Sub Form_Load()
    Me.comRole.AddItem ("Coordinator")
    Me.comRole.AddItem ("Technic")
    Me.comRole.AddItem ("Dummy")
End Sub
